import Vue from 'vue'
import VueRouter from 'vue-router'
import userLayout from '@/layout/Default/index'

// 重写push方法，a -> b -redirect-> a报错
// https://github.com/vuejs/vue-router/issues?q=is%3Aissue+NavigationDuplicated+is%3Aclosed
const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error => error)
}
Vue.use(VueRouter)

// 导入基础路由
import baseRoutes from './base'



const router = new VueRouter({
  routes: baseRoutes
})

export default router
